{extend name="../admin/common/base" /}
{block name="body"}
<form class="layui-form" method="post" style="padding-right: 10px;">
    <div class="layui-form-item">
        <label class="layui-form-label">公众号名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" value="{$mp.name}" required lay-verify="required" placeholder="请输入公众号名称" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">类型</label>
        <div class="layui-input-block">
            <input type="radio" {eq name="$mp.type" value="1"} checked {/eq}  name="type" value="1" title="普通订阅号">
            <input type="radio" {eq name="$mp.type" value="2"} checked {/eq} name="type" value="2" title="认证订阅号">
            <input type="radio" {eq name="$mp.type" value="3"} checked {/eq} name="type" value="3" title="普通服务号">
            <input type="radio" {eq name="$mp.type" value="4"} checked {/eq} name="type" value="4" title="认证服务号/认证媒体/政府订阅号">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">APPID</label>
        <div class="layui-input-block">
            <input type="text" name="appid" value="{$mp.appid}" required lay-verify="required" placeholder="请输入APPID" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">APPSECRET</label>
        <div class="layui-input-block">
            <input type="text" name="appsecret" value="{$mp.appsecret}" required lay-verify="required" placeholder="请输入APPSECRET"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">原始ID</label>
        <div class="layui-input-block">
            <input type="text" name="origin_id" value="{$mp.origin_id}"  placeholder="请输入原始ID" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">微信号:</label>
        <div class="layui-input-block">
            <input type="text" name="mp_number"  value="{$mp.mp_number}" placeholder="请输入公众号微信号"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">LOGO</label>
        <div class="layui-input-block">
            {:hook('Upload',['type'=>'image','name'=>'logo','value'=>$mp.logo])}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">二维码</label>
        <div class="layui-input-block">
            {:hook('Upload',['type'=>'image','name'=>'qrcode','value'=>$mp.qrcode])}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">开关状态</label>
        <div class="layui-input-block">
            <input name="status" value="1" {eq name="$mp.status" value="1"} checked {/eq}  title="开启"  type="radio">
            <input name="status" value="0" {eq name="$mp.status" value="0"} checked {/eq} title="关闭" type="radio">
        </div>
    </div>


    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">关闭回复</label>
        <div class="layui-input-block">
            <textarea name="desc"  placeholder="请输入内容" class="layui-textarea">{$mp.desc}</textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input name="id" type="hidden" value="{$mp.id}">
            <button class="layui-btn" lay-submit lay-filter="sbm">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>

<script>
    layui.use('form', function () {
        var form = layui.form;
        form.on('submit(sbm)', function (data) {
            $.post('',data.field,function (res) {
                if(res.status=='1'){
                    layer.msg(res.msg,{time:1000},function () {
                       // window.location.href=res.url;
                    });
                }
            })
            return false;
        });
    });
</script>
{/block}